@echo off
echo === Building DevOps Platform with VC++2005 ===

call "C:\Program Files (x86)\Microsoft Visual Studio 8\VC\vcvarsall.bat" x86

if not exist build mkdir build

echo Compiling main.cpp...
cl.exe /nologo /c /MT /O2 /DNDEBUG /Isrc /Fobuild\main.obj src\main-vc2005.cpp

if %errorlevel% neq 0 (
    echo Compilation failed!
    exit /b 1
)

echo Linking executable...
link.exe /nologo /OUT:build\DevOpsPlatform.exe build\main.obj kernel32.lib user32.lib

if %errorlevel% equ 0 (
    echo Build successful!
    build\DevOpsPlatform.exe status
) else (
    echo Linking failed!
    exit /b 1
)
